package vip.xiaonuo.modular.upGradingBusiness.dto;

import lombok.Data;
import org.apache.http.NameValuePair;
import vip.xiaonuo.modular.util.HttpClientService;

import java.util.List;

/**
 * @author hrd
 * @version 1.0
 * @date 2022/2/12 20:34
 */
@Data
public class ValidateCodeParam {
    private Object[] params;
    private Object[] values;

    public static void main(String[] args) throws Exception{
        String url = "https://wap.gd.10086.cn/businessHsh/hshShop/feeset/commodityOrder/getValidateRndCode.jsps?jsoncallback=jQuery33108976162749964309_1644481659743&mobile=15899759240&commCode=5GCXTC139&merchantCode=ECOP_ZNZD&jNumber=pBP4DipyBJNxDAfRuG9xBw%3D%3D&transType=2&_=1644481844559";


        Object [] params = new Object[]{"jsoncallback","mobile","commCode","merchantCode","jNumber","transType","_"};


        Object [] values = new Object[]{"jQuery33108976162749964309_1644481659743","15899759240","5GCXTC139","ECOP_ZNZD","pBP4DipyBJNxDAfRuG9xBw%3D%3D","2","1644481844559"};

        // String url = "https://gd.10086.cn/broswer/uat/getMobileRedirectHost";
        /**
         * 参数值
         */
        // Object [] params = new Object[]{};
        /**
         * 参数名
         */
        // Object [] values = new Object[]{};
        /**
         * 获取参数对象
         */
        List<NameValuePair> paramsList = HttpClientService.getParams(params, values);
        /**
         * 发送get
         */
        Object result = HttpClientService.sendGet(url, null);
        /**
         * 发送post
         */
        //  Object result2 = HttpClientService.sendPost(url, paramsList);

        System.out.println("GET返回信息：" + result);
        // System.out.println("POST返回信息：" + result2);
    }
}
